<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Map类型的增删改查</title>
</head>
<body>
    <script>
        let obj = {
            "name" : "css"
        };

        let map = new Map();

        // 增
        map.set(obj,"xiasnn");
        map.set("age",18);
        console.log(map);

        // 删
        // 删除指定元素
        // console.log(map.delete(obj));   //true
        // console.log(map);
        // 全部清空
        // map.clear();
        // console.log(map);

        // 查
        console.log(map.has("age"));    //true
        console.log(map.has("site"));   //false
        // console.log(map.get({
        //     "name" : "css"
        // })) //这样是取不到的

        console.log(map.get(obj));  //xiasnn
    </script>
</body>
</html>